use std::time::Duration;

#[derive(Debug, Clone)]
pub struct RequestSpec {
    pub base_url: String,
    pub endpoint: String,
    pub method: HttpMethod,
    pub content_type: ContentType,
    pub headers: Vec<(String, String)>,
    pub timeout: Option<Duration>,
    pub checks: Vec<Check>,
}

#[derive(Debug, Clone, Copy, PartialEq)]
pub enum HttpMethod {
    GET,
    POST,
}

#[derive(Debug, Clone, Copy)]
pub enum ContentType {
    Json,
    Form,
}

#[derive(Debug, Clone)]
pub enum Check {
    Http2xx,
    Code { field: String, success: i64 },
    Ok { field: String, success: bool },
}
